$(function(){
	$("#login").dialog({
		title:'登录界面',
		maximizable:'true',
		modal:true,
		closed: false,   
	    cache: true,
		buttons:[{
			text:'登录',
			handler:function(){
				btnLogin();
				//$("form")[0].submit();
			}
		},{
			text:'取消',
			handler:function(){
				$("#login").dialog("close");
			}
		}]
	});
	$("#loginDialog").live("click",function(){
		$("#login").dialog('open');
	});
	
	$("#logoutDialog").live("click",function(){
		$.messager.confirm('Confirm','确定注销?',function(r){   
		    if (r){   
		        alert('ok');   
		    }   
		}); 
	});
			
});
function btnLogin(){
	var objForm=$("form")[0];
	var login=$("#dllogin").val();
	var pwd=$("#dlpassword").val();
	var ip=$("#ip").val();
	alert("ip");
	var url="departmentLogin_findLogin?departmentLogin.dllogin="+login+"&departmentLogin.dlpassword="+pwd+"&ip="+ip;
	objForm.action=url;
	objForm.submit();
	alert(url);
}
function btnLogout(){
	var objForm=$("form")[0];
	var url="departmentLogin_Logout";
	objForm.action=url;
}
